package com.one.square.oauth.exception;

import com.one.square.core.enums.ResultCode;
import org.springframework.http.HttpStatus;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**
 * @author cwm
 * @Description 方法不允许访问异常
 * @date 2021/10/26 上午11:32
 * @Version 1.0
 */
public class MethodNotAllowed extends OAuth2Exception {
    public MethodNotAllowed(String msg, Throwable t) {
        super(msg, t);
    }
    @Override
    public int getHttpErrorCode() {
        return HttpStatus.METHOD_NOT_ALLOWED.value();
    }

    @Override
    public String getOAuth2ErrorCode() {
        return ResultCode.METHOD_NOT_ALLOWED.getMsg();
    }
}
